/**
 * LinkedLst, Kellen Donohue
 * May 4, 2011
 * TestJSONParser.java - Used to test front-end/back-end communication and JSON parsing
 */

package edu.washington.cs.labspecimentransport.data;

import java.util.Map;

import edu.washington.cs.labspecimentransport.dataobjects.ItemAttribute;

/**
 * @author Kellen
 * 
 */
public class TestJSONParser {
	// Test class, we don't care if things are unused
	@SuppressWarnings("unused")
	public static void main(String[] args) throws Exception {
		DataQuery dq = DataQuery.getInstance();
		dq.authenticate("admin", "password");
		int courierId = 598124354;
		/*
		 * List<Location> locs = dq.getLocationsByCourierId(courierId); for
		 * (Location loc : locs) { for (Item i :
		 * dq.getItemsByLocation(598124354, loc.getId())) {
		 * System.out.println(i.getId()); } }
		 */
		Map<ItemAttribute, Integer> obj = dq
				.getCountOfColorsForBag("51vQN025FrAuU");
		for (ItemAttribute o : obj.keySet()) {
			System.out.println(o.getDisplay_text() + ":" + obj.get(o));
		}
		/*
		 * 
		 * System.out.println(dq.getBarcodeByItemId(450215437)); List l = new
		 * ArrayList(); l.add(450215437);
		 * System.out.println(dq.getItemTypesByIds(l));
		 * 
		 * /* Item i = new Item();
		 * i.set_id(dq.getItemIdByBarcode("000123456784")); List<Integer> items
		 * = new ArrayList<Integer>(); items.add(i.getId());
		 * dq.markItemsAsPickedUp(64810937, 93868891, items);
		 * 
		 * /* String url =
		 * "http://localhost:3000/items/64810937.json";///175142436.json";
		 * HttpRequest get;// = new HttpRequest();
		 * HttpRequest.authenticate("user", "password");
		 * 
		 * String result = HttpRequest.sendRequest(url);
		 * System.out.println(result); // JSONObject obj =
		 * org.json.XML.toJSONObject(result); JSONObject obj = new
		 * JSONObject(result);
		 * 
		 * @SuppressWarnings("unused") JavaObjectPopulator jop = new
		 * JavaObjectPopulator(obj); //
		 */
	}
}
